package club.zbiao.modules.system.service;

import club.zbiao.modules.system.domain.Menu;
import club.zbiao.modules.system.domain.Role;
import club.zbiao.modules.system.service.dto.RoleDTO;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;

/**
 * @author jie
 * @date 2018-12-03
 */
@CacheConfig(cacheNames = "role")
public interface RoleService extends BaseService<RoleDTO, Role> {

    /**
     * updatePermission
     *
     * @param resources
     * @param roleDTO
     */
    @CacheEvict(allEntries = true)
    void updatePermission(Role resources, RoleDTO roleDTO);

    /**
     * updateMenu
     *
     * @param resources
     * @param roleDTO
     */
    @CacheEvict(allEntries = true)
    void updateMenu(Role resources, RoleDTO roleDTO);

    @CacheEvict(allEntries = true)
    void untiedMenu(Menu menu);
}
